AccelLabel: Fix displaying accel unichars >= 0x80
authorDaniel Boles <dboles@src.gnome.org>
Sat, 5 Aug 2017 19:21:28 +0000 (20:21 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Sat, 5 Aug 2017 19:27:43 +0000 (20:27 +0100)
In GTK+ 2, the ch < 0x80 was ORd with klass->latin1_to_char, and that
was unconditionally set to TRUE in the class init function, so
effectively the ch < 0x80 never mattered before or served any purpose.

When klass->latin1_to_char was deleted from the class in commit
f760538f17673c5bd7fec792be2f1abf8148fc32, this check’s sense changed.

The resuls was that accel keyvals with gunichar value >= 0x80 stopped
being rendered as symbols, instead falling back to their keysym name.
Instead of recognisable symbols for these, we get raw, often obscure,
and untranslatable keysym names. This breaks accessibility as well as
client users who may be parsing such accels and migrating from GTK+ 2.

So, remove the < 0x80 to restore the behaviour from before said commit.

https://bugzilla.gnome.org/show_bug.cgi?id=783906

gtk/gtkaccellabel.c

index 520c2a59670cb9fe5ed6af523be5c6f06ee19e78..6b344a63ffd8e72236f658c8844092ff98bd6ecf 100644 (file)
@@ -816,7 +816,7 @@ _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
     }
   
   ch = gdk_keyval_to_unicode (accelerator_key);
-  if (ch && ch < 0x80 && (g_unichar_isgraph (ch) || ch == ' '))
+  if (ch && (ch == ' ' || g_unichar_isgraph (ch)))
     {
       if (seen_mod)
         g_string_append (gstring, klass->mod_separator);